<?php

if (!defined('BASEPATH'))
    exit('No direct script access allowed');

class Designers extends CI_Controller {

    public function __construct() {
        parent::__construct();
        $this->load->helper('url');
        $this->load->model('designers_m');
        $this->load->model('products_m');
    }    
    
    public function index() {
        //open
        $temp = array();
        $temp['css'] = array('header','designers');
        $temp['js'] = array('designers');
        $this->load->view('open_v',$temp);
        //main
        $data['designers'] = $this->designers_m->get_designers_front();
        $this->load->view('designers/list_designers_v',$data);
        //close
        $this->load->view('close_v');
    }
    
    public function next_page($page=null,$prefix=null){
        $data['designers'] = $this->designers_m->get_designers_front($prefix,$page-1);
        $this->load->view('designers/ajax_designers_content',$data);
    }
    
    public function view($id){
        //open
        $temp = array();
        $temp['css'] = array('header','designers');
        $temp['js'] = array('designers');
        $this->load->view('open_v',$temp);
        //main
        $data['designer'] = $this->designers_m->get_designer_front($id);
        $this->load->view('designers/designer_v',$data);
        //close
        $this->load->view('close_v');
    }
    
    public function indeks($prefix){
        //open
        $temp = array();
        $temp['css'] = array('header','designers');
        $temp['js'] = array('designers');
        $this->load->view('open_v',$temp);
        //main
        $data['designers'] = $this->designers_m->get_designers_front($prefix);
        $data['prefix'] = $prefix;
        $this->load->view('designers/list_designers_v',$data);
        //close
        $this->load->view('close_v');
    }
}